home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WACCEL_HPP_INCLUDED
- #define _WACCEL_HPP_INCLUDED
- #pragma once
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WDEF_HPP_INCLUDED
- # include "wdef.hpp"
- #endif
- #ifndef _WOBJECT_HPP_INCLUDED
- # include "wobject.hpp"
- #endif
- #ifndef _WKEYDEFS_HPP_INCLUDED
- # include "wkeydefs.hpp"
- #endif
- #ifndef _WRESID_HPP_INCLUDED
- # include "wresid.hpp"
- #endif
-
- class WWindow;
- class WMenu;
- class WAcceleratorReference;
-
- enum WAcceleratorHandle { NULLHACCEL = 0, LASTHACCEL = LAST_16TO32BIT };
-
- class WCMCLASS WAcceleratorTable : public WObject {
- WDeclareSubclass( WAcceleratorTable, WObject );
-
- public:
-
- /*************************************************************
- * Constructors and destructors
- *************************************************************/
-
- WAcceleratorTable();
-
- WAcceleratorTable( const WAcceleratorTable & table );
-
- WAcceleratorTable( WAcceleratorHandle handle,
- WBool destroyTable=FALSE );
-
- WAcceleratorTable( const WResourceID & id,
- WModuleHandle module=_ApplicationModule );
-
- ~WAcceleratorTable();
-
- /*************************************************************
- * Properties
- *************************************************************/
-
- // Handle
-
- WAcceleratorHandle GetHandle() const;
-
- /*************************************************************
- * Methods
- *************************************************************/
-
- // Add
- //
- // Adds a new accelerator key to the accelerator table.
- // Note that this causes the old table to be destroyed
- // and a new one created.
-
- WBool Add( WKeyState state, WKeyPressCode code,
- WUShort accelID=0, WBool noInvert=FALSE );
- WBool Add( const WAcceleratorTable & table );
-
- // AppendToMenuItems
- //
- // Given a menu, adds accelerators to the captions for
- // the menuitems that correspond to accelerators in
- // the accelerator table.
-
- WBool AppendToMenuItems( WMenu *menu );
-
- // Clear
-
- void Clear();
-
- // Create
-
- WBool Create( const WAcceleratorTable & table );
- WBool Create( WAcceleratorHandle handle, WBool destroyTable=FALSE );
- WBool Create( const WResourceID & id, WModuleHandle module=_ApplicationModule );
-
- /**********************************************************
- * Operators
- *********************************************************/
-
- WAcceleratorTable & operator=( const WAcceleratorTable & t );
-
- /*************************************************************
- * Data members
- *************************************************************/
-
- private:
-
- WAcceleratorReference * _ref;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WACCEL_HPP_INCLUDED
-